package com.weds.frame.auth.mapper;

import com.weds.frame.auth.entity.ScUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.scheduling.annotation.Async;

import java.util.List;

@Mapper
public interface ScUserAuthUnderMapper {
    int deleteByPrimaryKey(Integer userId);

    int insert(ScUser record);

    int insertSelective(ScUser record);

    ScUser selectByPrimaryKey(Integer userId);

    int updateByPrimaryKeySelective(ScUser record);

    List<ScUser> selectCardInfo(Integer userId);

    int updateByPrimaryKey(ScUser record);

    List<ScUser> loginCheck(@Param("type") Integer type, @Param("loginName") String loginName, @Param("pwd") String pwd, @Param("imgPath") String imgPath);

    List<ScUser> loginCasCheck(@Param("loginName") String  loginName,@Param("imgPath") String imgPath);

    int updatePhoneNoByUserId(@Param("userId") Integer userId, @Param("phoneNo") String phoneNo);

    int updateUserPasswordByUserId(@Param("userId") Integer userId, @Param("userPassword") String userPassword);

    int updateUserStateByUserId(@Param("userId") Integer userId, @Param("userState") Integer userState);

    List<ScUser> getUserByNo(@Param("userNo") String userNo);

    List<ScUser> getUserByNoModify(@Param("userNo") String userNo,@Param("userId") Integer userId);

    List<String> getBatchName(@Param("idList") List<Integer> idList);

    int batchUpdateByUserId(@Param("userIds") String userIds);


    List<ScUser> selectUserByLike(@Param("likeStr") String likeStr, @Param("client")String client,@Param("loginUserId")Integer loginUserId);

    @Async
    void passUpdateGatingUser(@Param("userId") Integer userId,@Param("cardHao") String cardHao,@Param("operator") String operator);

    @Async
    void passDeleteGatingUser(@Param("userId") Integer userId,@Param("cardHao") String cardHao,@Param("operator") String operator);


    int deleteCardByUserId(@Param("userId") Integer userId);

    int updateByDeptId(ScUser scUser);

    Integer isDormRole(Integer userId);

}